package com.example.minisqlite;

import java.sql.SQLException;

public enum ColumnType {
    INTEGER,
    TEXT,
    REAL;

    public static ColumnType fromKeyword(String keyword) throws SQLException {
        switch (keyword.toUpperCase()) {
            case "INTEGER":
                return INTEGER;
            case "TEXT":
                return TEXT;
            case "REAL":
                return REAL;
            default:
                throw new SQLException("Unsupported column type: " + keyword);
        }
    }
}
